% engine=luatex
% \ctxlua{fonts.collections.trace = true}
\definefontfeature[zh][mode=node,script=hang,lang=zhs]

\starttypescript [serif] [zhfont]
    \definefontsynonym [zhserif]
                       [AdobeSongStd-Light][features=zh]
    \definefontsynonym [zhserifbold]
                       [AdobeHeitiStd-Regular][features=zh]
    \definefontsynonym [zhserifitalic][AdobeKaitiStd-Regular]
                       [features=zh]
    \definefontsynonym [zhserifbolditalic]
                       [AdobeHeitiStd-Regular][features=zh]
    \definefontfallback[serifwhatever]
                       [lmroman10-regular][0x0000-0x0400][force=yes]
    \definefontfallback[serifboldwhatever]
                       [lmroman10-bold][0x0000-0x0400][force=yes]
    \definefontfallback[serifitalicwhatever]
                       [lmroman10-italic][0x0000-0x0400][force=yes]
    \definefontfallback[serifbolditalicwhatever]
                       [lmroman10-bolditalic][0x0000-0x0400][force=yes]
\stoptypescript

\starttypescript [serif][zhfont][name]
    \definefontsynonym[Serif]
                      [zhserif][fallbacks=serifwhatever]
    \definefontsynonym[SerifBold]
                      [zhserifbold][fallbacks=serifboldwhatever]
    \definefontsynonym[SerifItalic]
                      [zhserifitalic][fallbacks=serifitalicwhatever]
    \definefontsynonym[SerifBoldItalic]
                      [zhserifbolditalic][fallbacks=serifbolditalicwhatever]
\stoptypescript

\starttypescript [sans][zhfont]
    \definefontsynonym [zhsans]
                       [AdobeKaitiStd-Regular][features=zh]
    \definefontsynonym [zhsansbold]
                       [AdobeHeitiStd-Regular][features=zh]
    \definefontsynonym [zhsansitalic]
                       [AdobeKaitiStd-Regular][features=zh]
    \definefontsynonym [zhsansbolditalic]
                       [AdobeHeitiStd-Regular][features=zh]
    \definefontfallback[sanswhatever]
                       [lmsans10-regular][0x0000-0x0400][force=yes]
    \definefontfallback[sansboldwhatever]
                       [lmsans10-Bold][0x0000-0x0400][force=yes]
    \definefontfallback[sansitalicwhatever]
                       [lmsans10-italic][0x0000-0x0400][force=yes]
    \definefontfallback[sansbolditalicwhatever]
                       [lmsans10-bolditalic][0x0000-0x0400][force=yes]
\stoptypescript

\starttypescript [sans][zhfont][name]
    \definefontsynonym[Sans]
                      [zhsans][fallbacks=sanswhatever]
    \definefontsynonym[SansBold]
                      [zhsansbold][fallbacks=sansboldwhatever]
    \definefontsynonym[SansItalic]
                      [zhsansitalic][fallbacks=sansitalicwhatever]
    \definefontsynonym[SansBoldItalic]
                      [zhsansbolditalic][fallbacks=sansbolditalicwhatever]
\stoptypescript

\starttypescript [mono][zhfont]
    \definefontsynonym [zhmono]
                       [AdobeKaitiStd-Regular][features=zh]
    \definefontsynonym [zhmonobold]
                       [AdobeHeitiStd-Regular][features=zh]
    \definefontsynonym [zhmonoitalic]
                       [AdobeKaitiStd-Regular][features=zh]
    \definefontsynonym [zhmonobolditalic]
                       [AdobeHeitiStd-Regular][features=zh]
    \definefontfallback[monowhatever]
                       [lmmono10-regular][0x0000-0x0400][force=yes]
    \definefontfallback[monoboldwhatever]
                       [lmmonolt10-bold][0x0000-0x0400][force=yes]
    \definefontfallback[monoitalicwhatever]
                       [lmmono10-italic][0x0000-0x0400][force=yes]
    \definefontfallback[monobolditalicwhatever]
                       [lmmonolt10-boldoblique][0x0000-0x0400][force=yes]
\stoptypescript

\starttypescript [mono][zhfont][name]
    \definefontsynonym[Mono]
                      [zhmono][fallbacks=monowhatever]
    \definefontsynonym[MonoBold]
                      [zhmonobold][fallbacks=monoboldwhatever]
    \definefontsynonym[MonoItalic]
                      [zhmonoitalic][fallbacks=monoitalicwhatever]
    \definefontsynonym[MonoBoldItalic]
                      [zhmonobolditalic][fallbacks=monobolditalicwhatever]
\stoptypescript

\starttypescript[myfont]
    \definetypeface[myfont][rm][serif][zhfont]
    \definetypeface[myfont][ss][sans][zhfont]
    \definetypeface[myfont][tt][mono][zhfont]
\stoptypescript
